package com.trustasia.action;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class ParameterAction {
	
	@RequestMapping(value="/test/{name}/{password}/{id}" ,method=RequestMethod.GET)
	public @ResponseBody void test(@PathVariable("name") String name,@PathVariable("password") String password,@PathVariable("id") Integer id)	{
		System.out.println("-----------"+name);
		System.out.println("-----------"+password);
		System.out.println("-----------"+id);
		
		
	}
	
	@RequestMapping(value="/test/session")
	public @ResponseBody void test1(@CookieValue(value="JSESSIONID",defaultValue="是空的") String sessionId){
		System.out.println("----------"+sessionId);
	}
	@RequestMapping(value="/test/requestHead")
	public @ResponseBody void test2(@RequestHeader(value="user" ,defaultValue="" )String user,@RequestHeader(value="accept" ,defaultValue="") String accept){
		System.out.println("user------"+user);
		System.out.println("accept------"+accept);
	}
	 

}
